Skip to main content

Knowledge Repository

Empower your agents with semantic search capabilities by connecting them to your documents.

This guide will walk you through configuring the KnowledgeRepo tool to enable Agentic-Retrieval-Augmented Generation (A-RAG), allowing your agents to give answers grounded in your specific data.

💡 Core Concepts

To configure this tool, you need to understand how data ingestion and search scoping work.

1. How it works

The Knowledge Repository (KR) indexes your documents so agents can retrieve, analyze, and answer queries based on that content rather than hallucinating.

  1. Ingest: Upload documents (PDFs) directly or use SVAHNAR Connectors.
  2. Index: The repository preprocesses content (including OCR for image-based PDFs) for semantic search.
  3. Query: Agents fetch relevant information to produce accurate answers.

2. Supported Data Sources

You can upload files manually or use Connectors to index external sources automatically:

3. Search Scoping (Filtering)

You can restrict the search to specific data subsets using IDs:

  • Knowledge Repo ID (k_repo_id): Restricts search to a specific repository UUID.
  • Document ID (doc_id): Restricts search to a specific document UUID within a repository.
Access Control

Permissions are inherited. If a user has permission to access an agent associated with a Knowledge Repository in your organization, they automatically inherit access to that repository. You do not need to configure separate permissions.


⚙️ Configuration Steps

Follow these steps to integrate the Knowledge Repository with your agent.

Prepare your Repository

Before configuring the agent, ensure your documents are uploaded and indexed.

  1. Navigate to the Knowledge Repository section in the SVAHNAR dashboard.
  2. Create a new Repository or identify an existing one.
  3. Upload your PDFs or configure a Connector (e.g., AWS S3, Confluence).
  4. Copy the Repository UUID (and optional Document UUID if scoping is required).
Best Practice

Upload canonical, versioned copies of documents when possible to avoid indexing transient drafts.

Configure Tool in Agent

Add the KnowledgeRepo tool to your agent's configuration YAML.

Key Configuration Parameter:

  • k_repo_id: The unique UUID of the repository you want this agent to search.

Define Agent Function

Instruct your agent on when to use this tool in the agent_function section.

  • Example Instruction: "If the user asks about internal HR policies, use the KnowledgeRepo tool to find the answer."
  • Query Input: The agent will automatically generate the query string based on the user's natural language question.

📚 Practical Recipes (Examples)

Use Case: An agent that searches an entire Knowledge Repository to answer questions.

create_vertical_agent_network:
agent-1:
agent_name: researcher_agent
LLM_config:
params:
model: gpt-5-mini
tools:
tool_assigned:
- name: KnowledgeRepo
config:
# The UUID of your Knowledge Repository
k_repo_id: "550e8400-e29b-41d4-a716-446655440000"
agent_function:
- "Search the knowledge repository for relevant passages and answer the user's question."
incoming_edge:
- Start
outgoing_edge: []

Recipe 2: Scoped Search (Specific Document)

Use Case: An agent restricted to searching a specific document within a repository (e.g., searching only the "Employee Handbook").

create_vertical_agent_network:
agent-1:
agent_name: hr_policy_bot
LLM_config:
params:
model: gpt-5-mini
tools:
tool_assigned:
- name: KnowledgeRepo
config:
k_repo_id: "550e8400-e29b-41d4-a716-446655440000"
# Restrict search to this specific document UUID
doc_id: "123e4567-e89b-12d3-a456-426614174000"
agent_function:
- "You are an HR assistant. Use the KnowledgeRepo tool to answer policy questions found in the handbook."
incoming_edge:
- Start
outgoing_edge: []

🚑 Troubleshooting

  • "Invalid Knowledge Repository ID" Error

    • Ensure the k_repo_id provided is a valid UUID format.
    • Check for whitespace characters pasted accidentally into the YAML.
  • "You do not have permission to access..."

    • This occurs if the k_repo_id exists but belongs to a different organization and is not marked as is_global.
    • Private Repos: Only the creator and authorized organization members can access them. verify the ownership of the Knowledge Repository.
  • Poor Search Results

    • Ensure the documents have finished Indexing. Large PDFs may take a few moments to process (especially if OCR is required).
    • Verify that the documents contain text and are not just flattened images without OCR processing.

💰 Additional Credit Consumption

The KnowledgeRepo tool consumes credits based on the number of pages in the documents it indexes. Each page (up to legal size) consumes one credit.